package com.yellowninja.backup.ui;

import java.awt.BorderLayout;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import javax.swing.border.EtchedBorder;

/**
 * Status bar with two areas.
 * 
 * @author Devin Gillman
 * 
 */
public class StatusBar extends JPanel {
	static final long serialVersionUID = 1L;

	private JLabel label;

	/**
	 * Create a new status bar with the given text and icon.
	 * 
	 * @param leftText
	 *            The text of the status bar.
	 * @param leftIcon
	 *            The icon of the status bar.
	 */
	public StatusBar(String text, ImageIcon icon) {
		this.setLayout(new BorderLayout());
		this.setOpaque(true);
		this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
		// this.setBackground(SubstanceLookAndFeel.getCurrentSkin()
		// .getMainActiveColorScheme().getDarkColor());

		label = new JLabel(text);
		label.setIcon(icon);
		this.add(label, BorderLayout.WEST);
	}

	/**
	 * Sets the text of the label.
	 * 
	 * @param text
	 *            The text to set for the label.
	 */
	public void setText(String text) {
		label.setText(text);
	}

	/**
	 * Sets the icon of the label.
	 * 
	 * @param icon
	 *            The icon to set for the label.
	 */
	public void setIcon(ImageIcon icon) {
		label.setIcon(icon);
	}
}
